# -------------- Configuration of Radium PluginBase targets and definitions ---
# Setup Gui and check for dependencies
# TODO : verify if this is needed
if(PluginBase_FOUND AND NOT TARGET PluginBase)
    set(Configure_PluginBase ON)
    # verify dependencies
    if(NOT Gui_FOUND)
        if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/../Gui/RadiumGuiConfig.cmake")
            set(Gui_FOUND TRUE)
            include(${CMAKE_CURRENT_LIST_DIR}/../Gui/RadiumGuiConfig.cmake)
        else()
            set(Radium_FOUND False)
            set(Radium_NOT_FOUND_MESSAGE "Radium::PluginBase: dependency Gui not found")
            set(Configure_PluginBase OFF)
        endif()
    endif()
endif()

if(Configure_PluginBase)
    include(${CMAKE_CURRENT_LIST_DIR}/../QtFunctions.cmake)
    check_and_set_qt_version("@QT_DEFAULT_MAJOR_VERSION@")
    find_qt_dependency(COMPONENTS Core REQUIRED)
    include("${CMAKE_CURRENT_LIST_DIR}/PluginBaseTargets.cmake")
    if(MSVC OR MSVC_IDE OR MINGW)
        get_target_property(QTLIB Qt::Core INTERFACE_LINK_LIBRARIES)
        add_imported_dir(FROM ${QTLIB} TO RadiumExternalDlls_location)
    endif()
endif()
